package com.uzai.console.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 运营商账户余额变动子类型
 * @Auther: liuqi
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum MerAccDetailSourceSubtypeEnum {
    PRODUCT_AUTH_TB("tb","淘宝"),
    PRODUCT_AUTH_JD("jd","京东"),
    PRODUCT_AUTH_PDD("pdd","拼多多"),
    PRODUCT_AUTH_VPH("vph","唯品会"),
    PRODUCT_AUTH_LOCAL_LIVE("local_live","本地生活"),
    PRODUCT_AUTH_UZAICHAT("uzaichat","悠聊"),
    PRODUCT_AUTH_CMS("cms","CMS"),

    //机器人续费
    DEVICE_AUTH_FL("fl","返利"),
    DEVICE_AUTH_PYQ("pyq","朋友圈"),
    DEVICE_AUTH_ALL("all","套餐(返利+朋友圈+悠聊)"),
    DEVICE_AUTH_UZAICHAT("uzaichat","悠聊"),
    DEVICE_AUTH_FD("fd","社群群发"),
    DEVICE_AUTH_TUO("tuo","气氛组(托)"),

    EXPORT_INFO_TB_ORDER("tb_order","淘宝订单"),
    EXPORT_INFO_JD_ORDER("jd_order","京东订单"),
    EXPORT_INFO_VPH_ORDER("vph_order","唯品会订单"),
    EXPORT_INFO_PDD_ORDER("pdd_order","拼多多订单"),
    EXPORT_INFO_MT_ORDER("mt_order","美团订单"),
    EXPORT_INFO_ELM_ORDER("elm_order","饿了么订单"),
    EXPORT_INFO_WECHAT_USER("wechat_user","个人微信用户"),
    EXPORT_INFO_WXWORK_USER("wxwork_user","企业微信用户"),
    EXPORT_INFO_WXPUB_USER("wxpub_user","公众号用户"),
    EXPORT_INFO_MINIPRO_USER("minipro_user","小程序用户"),
    EXPORT_INFO_TAKE_BAL("take_bal","提现列表"),
    EXPORT_INFO_RED_PACKET("red_packet","红包列表"),
    EXPORT_INFO_WXCONTACTS("wxcontacts","微信通讯录"),

    //短信付费
    SMS_PAY_SYS_WARN_MSG("sys_warn_msg","系统报警消息"),

    ;

    private String key;
    private String desc;

    MerAccDetailSourceSubtypeEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static MerAccDetailSourceSubtypeEnum getByKey(String key) {
        if (StringUtils.isBlank(key)) {
            return null;
        }
        for (MerAccDetailSourceSubtypeEnum type: MerAccDetailSourceSubtypeEnum.values()) {
            if (type.getKey().equals(key)) {
                return type;
            }
        }
        return null;
    }
}
